ui/layout


Auto.js Pro 9 Docs / ui/layout

ui/layout

Table of contents

Interfaces

Variables

Functions

Variables

R

Const R: Resources

Similar to Android's R, used to get resource related ID, such as R.drawable.ic_launcher and R.style.ScriptTheme.

Example

"nodejs";

const { R } = require("ui");

const context = $autojs.androidContext;
console.log(context.getDrawable(R.drawable.ic_delete))

See

https://developer.android.com/reference/android/R

Functions

defaultThemeContext

defaultThemeContext(): Context

Get the default theme context.

Returns

Context


inflateXml

inflateXml(ctx, xml, parent?, attachToParent?): JsView<View>

Inflate a new view hierarchy from the specified xml resource. Throws InflateException if there is an error.

Parameters

NameTypeDescription
ctxContextAndroid Contextopen in new window, if you want to create androidx-related views, you must specify a Material-related theme context
xmlstringxml content
parent?anyOptional view to be the parent of the generated hierarchy (if attachToRoot is true), or else simply an object that provides a set of LayoutParams values for root of the returned hierarchy (if attachToRoot is false.)
attachToParent?boolean-

Returns

JsView<View>